a='badminton'
a1=a.encode()
print(a1,type(a1))
a2=a1.decode()
print(a2,type(a2))
str='羽毛球'
str1=str.encode('utf-8')
print(str1,type(str1))
str2=str1.decode('utf-8')
print(str2,type(str2))
#字符串相加,加号相当于让相关字符按窜相连
print('10'+'10')
#*相当于字符串重复输出1    "\n"是换行符     "\t"是制表符(转义字符)拉大间距
name='Badminton'
print('n'in name)
print('v'in name)
print('n'not in name)
print('v'not in name)
#下标 在python中下标从0开始,从左往右数,超出下标范围就会报错   复数就从反方向开始
print(name[1])
print(name[-1])
#切片 [开始位置:结束位置:步长] 遵循包前不包后
print(name[0:3])
print(name[4:])
print(name[:5])
print(name[-1:-3:-1])